package com.yan.jdbcdemo;

import com.yan.domain.PageInfo;
import com.yan.domain.Stu;
import com.yan.utils.BaseDAO;
import org.junit.jupiter.api.Test;

import java.sql.SQLException;
import java.util.List;

/**
 * @author taoge
 * @Date 2024/8/23 16:26
 * @Description
 */
public class JDBCDemo4 {
    @Test
    public void test1(){
        List<Stu> list = BaseDAO.selectMutiply("select * from stu where address = ?", Stu.class , "北京");
        list.forEach(System.out::println);
    }

    // 分页查询
    @Test
    public void test2() throws SQLException {
        PageInfo<Stu> pageInfo = BaseDAO.pagingSelect("select * from stu", Stu.class, 1, 3);
        pageInfo.getDate().forEach(System.out::println);
    }
}
